-- Winter Anathema (c) v.v.balashoff
-- TODO www remove anc cleanup
--local CoreEntity = require('leviathan/ECS/Core/CoreEntity')
local Domain = require('leviathan/ECS/Domain')
--local ScriptComponent = require('leviathan/ECS/Script/Components/ScriptComponent')
local ScriptSystem = require('leviathan/ECS/Script/Systems/ScriptSystem')

local DomainScript = Domain:derive('Script')

function DomainScript:new(world)
    -- call parent constructor
    DomainScript.super.new(self, world, 'Script')
    self.priority = 3
    -- TODO www remove
--    -- components
--    local script = ScriptComponent('ScriptComponent')
    -- systems
    local scriptSystem = ScriptSystem(self)
    DomainScript:addSystem(self, scriptSystem)
end

function DomainScript:runScript(path)
    -- TODO www
    print('RUNNING SCRIPT: '..path)
    dofile(path)
print_r(self)
os.exit()
end

return DomainScript
